<script src="<?php echo base_url() ?>commons/validacion/js/jquery-1.8.2.min.js" type="text/javascript"></script>
<link href="<?php echo base_url() ?>commons/validacion/css/validationEngine.jquery.css" rel="stylesheet">
<script src="<?php echo base_url() ?>commons/validacion/js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo base_url() ?>commons/validacion/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>



<script>
            var t = jQuery.noConflict();
            t(document).ready(function() {
    // binds form submission and fields to the validation engine			
    t("#formID").validationEngine();
            t("#formID1").validationEngine();
    });
            /**
             *
             * @param {jqObject} the field where the validation applies
             * @param {Array[String]} validation rules for this field
             * @param {int} rule index
             * @param {Map} form options
             * @return an error string if validation failed
             */
                    function checkHELLO(field, rules, i, options) {
                    if (field.val() != "HELLO") {
                    // this allows to use i18 for the error msgs
                    return options.allrules.validate2fields.alertText;
                    }
                    }
</script>
<link rel="stylesheet" href="<? echo base_url() ?>commons/jquery/themes/base/jquery.ui.all.css">

<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.core.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.widget.js"></script>
<script src="<?php echo base_url() ?>commons/jquery/ui/jquery.ui.tabs.js"></script>

<script>
        var t1 = jQuery.noConflict();
        t1(function() {
        t1("#tabs").tabs();
        });</script>
<?php
echo '<script type="text/javascript">';
echo 'var t = jQuery.noConflict(); ';
echo 't(document).ready(function(){
	setTimeout(function(){ t(".mensajes").fadeOut(800).fadeIn(800).fadeOut(500).fadeIn(500).fadeOut(300);}, 3000); ';
echo '		});';
echo '</script>';
echo validation_errors('<div class="error">', '</div>');
if ($this->session->flashdata('error')) {
    echo "<div class='error mensajes'>";
    echo $this->session->flashdata('error');
    echo "</div>";
}
if ($this->session->flashdata('info')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('info');
    echo "</div>";
}
//alerta
if ($this->session->flashdata('exito')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('exito');
    echo "</div>";
}
if ($this->session->flashdata('alerta')) {
    echo "<div class='info mensajes'>";
    echo $this->session->flashdata('alerta');
    echo "</div>";
}
?>

<?php
$ci = &get_instance();
$ci->load->model("Docente_Model");
$recargo = 0.00;
$recargo = round(($inscrito[0]['tipo_matr'] == 1 ? 0 : ($inscrito[0]['tipo_matr'] == 2 ? ($costo_lec * 0.1) : ($costo_lec * 0.1) )), 2);
//$pago_inicial = (350 + $recargo);
//$pago_financiar = ($costo_lec + $recargo) - $pago_inicial;
?>

<form id="formID1" name="forma" class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/pagoinscrip/modificadatos" ?>" method="post" >


    <legend>PROCESAR DATOS DE LA INSCRIPCION</legend>

    <div class="tabbable">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#1" data-toggle="tab">Datos Generales</a></li>
            <li><a href="#2" data-toggle="tab">Datos Inscripci&oacute;n</a></li>
            <li><a href="#3" data-toggle="tab">Control de Pagos</a></li>
        </ul>
        <div class="tab-content">
            <?php foreach ($estudiante as $i => $est) { ?>
                <div class="tab-pane active" id="1">
                    <div class="control-group">
                        <label class="control-label" for="input01">N&uacute;mero de Identificaci&oacute;</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="cedula_pers" value= "<?php echo $est['cedula_pers']; ?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select01">Tipo de Documento</label>
                        <div class="controls">

                            <select id="select01"  name="tipo_doc_pers">

                                <option value= "0" <?php echo ($est['tipo_doc_pers'] == 0 ? " selected" : " "); ?>>CEDULA</option>
                                <option value= "1" <?php echo ($est['tipo_doc_pers'] == 1 ? " selected" : " "); ?>>PASAPORTE</option>
                                <option value= "2" <?php echo ($est['tipo_doc_pers'] == 2 ? " selected" : " "); ?>>CARNE DE REFUGIADO</option>
                            </select>

                        </div>
                    </div>


                    <div class="control-group">
                        <label class="control-label" for="input02">Nombre Completos</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="nombre_pers" value= "<?php echo $est['nombre_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input03">Apellidos </label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="apellido_pers" value= "<?php echo $est['apellido_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input04">Nacionalidad </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="nacionalidad_pers" value= "<?php echo $est['nacionalidad_pers']; ?>">
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input15">Provincia </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="provincia_pers" value= "<?php echo $est['provincia_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input05">Ciudad </label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="ciudad_pers" value= "<?php echo $est['ciudad_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input06">Direccion del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="direccion_pers" value= "<?php echo $est['direccion_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input07">Referencia del Domicilio</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="refer_domic_pers" value= "<?php echo $est['refer_domic_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">Tipo de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span4"  name="tipo_discap_pers" value= "<?php echo $est['tipo_discap_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input09">Carn&eacute; del CONADIS</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="conadis_pers" value= "<?php echo $est['conadis_pers']; ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input010">Porcentaje de Discapacidad</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="porc_disc_pers" value= "<?php echo $est['porc_disc_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="select01">Sexo</label>
                        <div class="controls">

                            <select id="select01"  name="sexo_pers">
                                <option <?php echo ($est['sexo_pers'] == "HOMBRE" ? " selected" : " "); ?>>HOMBRE</option>
                                <option <?php echo ($est['sexo_pers'] == "MUJER" ? " selected" : " "); ?>>MUJER</option>
                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select02">Estado Civil</label>
                        <div class="controls">

                            <select id="select02"  name="estado_civil_pers">
                                <option <?php echo ($est['estado_civil_pers'] == "SOLTERO(A)" ? " selected" : " "); ?>>SOLTERO(A)</option>
                                <option <?php echo ($est['estado_civil_pers'] == "CASADO(A)" ? " selected" : " "); ?>>CASADO(A)</option>
                                <option <?php echo ($est['estado_civil_pers'] == "UNION LIBRE" ? " selected" : " "); ?>>UNION LIBRE</option>
                                <option <?php echo ($est['estado_civil_pers'] == "DIVORCIADO(A)" ? " selected" : " "); ?>>DIVORCIADO(A)</option>
                                <option <?php echo ($est['estado_civil_pers'] == "VIUDO(A)" ? " selected" : " "); ?>>VIUDO(A)</option>
                                <option <?php echo ($est['estado_civil_pers'] == "ECLECIASTICO(A)" ? " selected" : " "); ?>>ECLECIASTICO(A)</option>


                            </select>

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="select12">Autodefinici&oacute;</label>
                        <div class="controls">

                            <select id="select02"  name="autodefin_pers">
                                <option <?php echo ($est['autodefin_pers'] == "NEGRO" ? " selected" : " "); ?>>NEGRO</option>
                                <option <?php echo ($est['autodefin_pers'] == "MULATO" ? " selected" : " "); ?>>MULATO</option>
                                <option <?php echo ($est['autodefin_pers'] == "AFROECUATORIANO" ? " selected" : " "); ?>>AFROECUATORIANO</option>
                                <option <?php echo ($est['autodefin_pers'] == "INDIGENA" ? " selected" : " "); ?>>INDIGENA</option>
                                <option <?php echo ($est['autodefin_pers'] == "MESTIZO" ? " selected" : " "); ?>>MESTIZO</option>
                                <option <?php echo ($est['autodefin_pers'] == "MONTUBIO" ? " selected" : " "); ?>>MONTUBIO</option>
                                <option <?php echo ($est['autodefin_pers'] == "BLANCO" ? " selected" : " "); ?>>BLANCO</option>
                                <option <?php echo ($est['autodefin_pers'] == "OTRO" ? " selected" : " "); ?>>OTRO</option>


                            </select>

                        </div>
                    </div>


                    <div class="control-group">
                        <label class="control-label" for="select03">Fecha de Nacimiento</label>
                        <div class="controls">
                            <input type="text" class="input-medium "  name="fecha_nac_pers" value="<?php echo date("m/d/Y", strtotime($est['fecha_nac_pers'])); ?>">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input08">N&uacute;mero de tel&eacute;fono</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="fono_pers" value= "<?php echo $est['fono_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input09">N&uacute;mero de celular</label>
                        <div class="controls">
                            <input type="text" class="input-medium span2"  name="celular_pers" value= "<?php echo $est['celular_pers']; ?>">

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input10">Correo Electr&oacute;nico Institucional</label>
                        <div class="controls">
                            <input type="text" class="input-medium span3"  name="email_inst_pers" value= "<?php echo $est['email_inst_pers']; ?>">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="input11">Fotograf&iacute;a</label>
                        <div class="controls">
                            <img src="<?php echo $est['foto_pers']; ?>" width="88" height="99" alt="itss1"/>
                        </div>
                    </div>



                </div>
            <?php } ?>
            <div class="tab-pane" id="2">
                <div class="control-group">
                    <label class="control-label" for="select01">PERIODO</label>
                    <div class="controls ">
                        <select name="ide_lec_nom" class="span3">
                            <option ><?php echo $ide_lec_nom; ?></option>
                        </select>

                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="select03">CARRERA</label>
                    <div class="controls ">
                        <select name="ide_car" class="span3" >
                            <option ><?php echo $ide_car_nom; ?></option>
                        </select>

                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="select03">Pensums</label>
                    <div class="controls ">
                        <select id="select02" name="ide_pen" class="span3">
                            <option ><?php echo $ide_pen_nom; ?></option>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="select04">Ciclo</label>
                    <div class="controls ">
                        <select id="select02" name="ide_ciclo" class="span3">

                            <option ><?php echo $ide_ciclo_nom; ?></option>
                        </select>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label" for="select02">JORNADA DE TRABAJO</label>
                    <div class="controls ">
                        <select name="seccion" class="span3">
                            <option ><?php echo $seccion_nom; ?></option>
                        </select>


                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="select02">PARALELO</label>
                    <div class="controls ">
                        <select name="paralelo" class="span1">
                            <option ><?php echo $paralelo_nom; ?></option>
                        </select>


                    </div>
                </div>
                <?php foreach ($inscrito as $i => $ins) { ?>


                    <div class="control-group">
                        <label class="control-label" for="select08">Fecha de la Inscripci&oacute;n</label>
                        <div class="controls">

                            <input type="text" class="input-medium "  name="fecha_matr" value="<?php echo date("m/d/Y", strtotime($ins['fecha_matr'])); ?>" >

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input02">Nro. de Cupo</label>
                        <div class="controls">
                            <input type="text" class="input-medium span1"  name="cupo" value="<?php echo $nro_cup; ?>" disabled>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label" for="input11">ESTADO </label>
                        <div class="controls">
                            <select id="estado_cur" name="estado_cur" disabled>
                                <option value="1" <?php echo ($ins['estado_matr'] == 1 ? " selected" : " "); ?>>EN PROCESO</option>
                                <option value="2" <?php echo ($ins['estado_matr'] == 2 ? " selected" : " "); ?>>ACEPTADA</option>
                                <option value="3" <?php echo ($ins['estado_matr'] == 3 ? " selected" : " "); ?>>NEGADA</option>
                                <option value="4" <?php echo ($ins['estado_matr'] == 4 ? " selected" : " "); ?>>DEVOLUCION</option>


                            </select>


                        </div>
                    </div>
                    <div id="tablamatriculai" >
                        <table class="table table-bordered table-striped table-condensed">
                            <thead>
                                <tr>
                                    <th>ASIGNA</th>
                                    <th>COD</th>
                                    <th>MATERIA</th>
                                    <th>CRED</th>
                                    <th>ESTADO</th>
                                    <th>DOCENTE</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                $nro_filas = 0;
                                if (!empty($materias)) {
                                    $nro_filas = count($materias);
                                    foreach ($materias as $i => $mat) {
                                        ?>
                                        <tr>
                                            <td ><div centrar align="center"><i class="icon-ok"></i>
                                                    <input type="hidden" <?php echo "name='ide_mat" . $i . "' value='" . $mat['ide_mat'] . "'"; ?>>
                                                </div></td>
                                            <td><?php echo $mat['codigo_mat'] ?></td>
                                            <td><?php echo $mat['nombre_mat'] ?></td>
                                            <td><?php echo $mat['creditos_mat'] ?></td>
                                            <td><?php echo ($mat['estado_cur'] == 0 ? 'ACTIVO' : 'PENDIENTE'); ?></td>
                                            <td >
                                                <select id="select01"  <?php echo "name='ide_doc" . $i . "'"; ?> class="span3">
                                                    <?php
                                                    $docentes = $this->Docente_Model->getDatosDocente($mat['ide_pers']);

                                                    foreach ($docentes as $k => $doc) {
                                                        echo ("<option value='" . $doc["ide_doc"] . "'>");
                                                        echo ($doc["apellido_pers"] . " " . $doc["nombre_pers"] . "</option>");
                                                    }
                                                    ?>

                                                </select>


                                            </td>   
                                        </tr>
                                        <?php
                                    }
                                }
                                ?>
                            </tbody>
                        </table>        
                    </div>     
                    <div class="control-group">
                        <label class="control-label" for="textarea">OBSERVACION</label>
                        <div class="controls">
                            <textarea class="input-xxlarge" id="observa_cur" name="observa_cur" rows="2" value=""><?php echo $ins['observ_mat']; ?></textarea>
                            <input type="hidden" name="id_matr" value="<?php echo $ins['id_matr']; ?>">
                            <input type="hidden" name="estado_matr" value="<?php echo $ins['estado_matr']; ?>">
                            <input type="hidden" name="ide_lec" value="<?php echo $ide_lec; ?>">
                            <input type="hidden" name="ide_lec_nom" value="<?php echo $ide_lec_nom; ?>">
                           
                            
                            
        
        
                            
                            <input type="hidden" name="modo_mat" value="<?php echo $modo_mat; ?>">
                        </div>
                    </div>
                <?php } ?>


            </div>
                <script>
                   function sumar(n, m, r) {
                    r.value = (n.value * 1) + (m.value * 1);
                   }
                    function ocultar_mostrar_doc(opc){
                        
                    var panel1 = document.getElementById("panel1");
                    var panel2 = document.getElementById("panel2");
                    var panel3 = document.getElementById("panel3");
                    var panel4 = document.getElementById("panel4");
                    var panel5 = document.getElementById("panel5");
                    var panel6 = document.getElementById("panel6");
                    var panel7 = document.getElementById("panel7");
                    opc=opc*1;
                    switch (opc) { 
                        case 1:
                            panel1.style.display='block';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 
                        case 2: 
                            panel1.style.display='nonce';
                            panel2.style.display='block';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                            
                        break 
                        case 3: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='block';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                            
                        break 
                        case 4: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='block';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 

                        case 5: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='block';
                            panel6.style.display='none';
                            panel7.style.display='none';
                        break 
                        case 6: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='block';
                            panel7.style.display='none';
                        break 
                        case 7: 
                            panel1.style.display='none';
                            panel2.style.display='none';
                            panel3.style.display='none';
                            panel4.style.display='none';
                            panel5.style.display='none';
                            panel6.style.display='none';
                            panel7.style.display='block';
                        break 

                    } //fin switch
                }


                </script>


            <div class="tab-pane" id="3">
                <div class="control-group">
                    <label class="control-label" for="input02">VALOR INSCRIPCION</label>
                    <div class="controls">
                         <input value="<?php echo $costo_inscrip_lec ?>" style="width: 60px;" name="monto_canc_ins" id="valor_ins"  
                               class="validate[required,maxSize[8],minSize[1],custom[number],min[0],max[10000]]" onkeyup="sumar(document.getElementById('<?php echo ("valor_ins"); ?>'), document.getElementById('<?php echo ("valor_conval"); ?>'), document.getElementById('<?php echo ("pago_i"); ?>'))">


                    </div>
                </div>
                <?php if($modo_mat==3){ // inscripcion por convalidacion?>
                <div class="control-group">
                    <label class="control-label" for="input02">CONVALIDACION</label>
                    <div class="controls">
                     <input value="<?php echo $costo_inscrip_conv_lec ?>" style="width: 60px;" name="costo_inscrip_conv_mat" id="valor_conval"  
                               class="validate[required,maxSize[8],minSize[1],custom[number],min[1],max[10000]]" onkeyup="sumar(document.getElementById('<?php echo ("valor_ins"); ?>'), document.getElementById('<?php echo ("valor_conval"); ?>'), document.getElementById('<?php echo ("pago_i"); ?>'))">

                    <!--    <input type="text" id="valor_conval" class="input-medium span2"  name="costo_inscrip_conv_mat" value="<?php echo $costo_inscrip_conv_lec ?>"
                               class="validate[required,maxSize[8],minSize[1],custom[number],min[0],max[10000]]" onkeyup="sumar(document.getElementById('<?php echo ("valor_ins"); ?>'), document.getElementById('<?php echo ("valor_conval"); ?>'), document.getElementById('<?php echo ("pago_i"); ?>'))">
                    -->

                    </div>
                </div>
                <?php }?>
                



                <br>
                <div class="control-group">
                    <label class="control-label" for="input31">TIPO DE DOCUMENTO</label>
                    <div class="controls">
                        <select id="tipo_doc_pago_mat" name="tipo_doc_pago_mat" ONCHANGE="javascript:ocultar_mostrar_doc(this.options[this.selectedIndex].value)">
                            <option value="1" <?php echo ($tipo_doc_pago_mat == 1 ? " selected" : " "); ?>>EFECTIVO</option>
                            <option value="2" <?php echo ($tipo_doc_pago_mat == 2 ? " selected" : " "); ?>>CHEQUE</option>
                            <option value="3" <?php echo ($tipo_doc_pago_mat == 3 ? " selected" : " "); ?>>DEPOSITO</option>
                            <option value="4" <?php echo ($tipo_doc_pago_mat == 4 ? " selected" : " "); ?>>TARJETA</option>
                            <option value="5" <?php echo ($tipo_doc_pago_mat == 5 ? " selected" : " "); ?>>EFECTIVO-CHEQUE</option>
                            <option value="6" <?php echo ($tipo_doc_pago_mat == 6 ? " selected" : " "); ?>>EFECTIVO-DEPOSITO</option>
                            <option value="7" <?php echo ($tipo_doc_pago_mat == 7 ? " selected" : " "); ?>>EFECTIVO-TARJETA</option>


                        </select>


                    </div>
                </div>                        
                        <?php if($tipo_doc_pago_mat==1 ){?>
                        <div id="panel1" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel1" style="display: none;">
                        <?php }?>
                        

                            <input type="hidden" name="nom_doc_pago_mat1" value="EFECTIVO">
                            <input type="hidden" name="nro_comp_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="lote_doc_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="ref_doc_pago_mat1" value="NINGUNO">
                            <input type="hidden" name="monto_efec_doc_pago1" value="0">
                            <input type="hidden" name="monto_rest_doc_pago1" value="0">
                            
                        </div>
                        <?php if($tipo_doc_pago_mat==2 ){?>
                        <div id="panel2" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel2" style="display: none;">
                        <?php }?>

                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DEL BANCO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nom_doc_pago_mat2" value="<?php echo($ins['nom_doc_pago_mat']); ?>" >

                                </div>
                            </div>  

                            <div class="control-group">
                                <label class="control-label" for="input02">NRO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="nro_comp_pago_mat2" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>
                            <input type="hidden" name="lote_doc_pago_mat2" value="NINGUNO">
                            <input type="hidden" name="monto_efec_doc_pago2" value="0">
                            <input type="hidden" name="monto_rest_doc_pago2" value="0">
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat2" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div>    

                        </div>

                        <?php if($tipo_doc_pago_mat==3 ){?>
                        <div id="panel3" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel3" style="display: none;">
                        <?php }?>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO DE LA CUENTA</label>
                                <div class="controls">
                                    <select  id="select01"  class="span3" name="nom_doc_pago_mat3">
                        <?php
                        $ci->load->model('Institucion_Model');
                        $cuentas = $ci->Institucion_Model->getCuentasInstitucionNombre("INSTITUTO TECNOLOGICO SUPERIOR SUDAMERICANO LOJA");
                        foreach ($cuentas as $k => $cuenta) {
                            echo ("<option value='" . $cuenta["cuenta1_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta1_inst"]? " selected" : " "))."/>");
                            echo ($cuenta["cuenta1_inst"] . "-" . $cuenta["banco1_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta2_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta2_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta2_inst"] . "-" . $cuenta["banco2_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta3_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta3_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta3_inst"] . "-" . $cuenta["banco3_inst"] . "</option>");
                        }
                        ?>

                                    </select>

                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input01">NRO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat3" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>  
                            <input type="hidden" name="lote_doc_pago_mat3" value="NINGUNO">
                            <input type="hidden" name="monto_efec_doc_pago3" value="0">
                            <input type="hidden" name="monto_rest_doc_pago3" value="0">
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat3" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div>   
                        <div class="control-group">
                            <label class="control-label" for="select012">FECHA DEL DEPOSITO</label>
                            <div class="controls">

                                <input type="text" class="input-medium "  id="datepicker3" name="fechadep_doc_pago_mat1" value="<?php echo date("m/d/Y", strtotime($ins['fechadep_doc_pago_mat'])); ?>" >

                            </div>
                        </div>
                            
                            </div>
                            
                        <?php if($tipo_doc_pago_mat==4 ){?>
                        <div id="panel4" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel4" style="display: none;">
                        <?php }?>
                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DE LA TARJETA</label>
                                <div class="controls">
                                    <select id="select01"  name="nom_doc_pago_mat4">

                                        <option value="MASTER CARD" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "MASTER CARD"? " selected" : " ")); ?>>MASTER CARD</option>
                                        <option value="DINERS CLUB" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "DINERS CLUB"? " selected" : " ")); ?> >DINERS CLUB</option>
                                        <option value="AMERICAN EXPRESS" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "AMERICAN EXPRESS"? " selected" : " ")); ?>>AMERICAN EXPRESS</option>
                                        <option value="VISA BANCO AUSTRO" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO AUSTRO"? " selected" : " ")); ?>>VISA BANCO AUSTRO</option>
                                        <option value="VISA BANCO MACHALA" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO MACHALA"? " selected" : " ")); ?>>VISA BANCO MACHALA</option>
                                    </select>
                                </div>
                            </div>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO TARJETA</label>

                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat4" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>



                            <div class="control-group">
                                <label class="control-label" for="input02">LOTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="lote_doc_pago_mat4" value="<?php echo($ins['lote_doc_pago_mat']); ?>" >

                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat4" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div>  
                            <input type="hidden" name="monto_efec_doc_pago4" value="0">
                            <input type="hidden" name="monto_rest_doc_pago4" value="0">
                            
                        </div>

                        <?php if($tipo_doc_pago_mat==5 ){?>
                        <div id="panel5" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel5" style="display: none;">
                        <?php }?>

                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DEL BANCO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nom_doc_pago_mat5" value="<?php echo($ins['nom_doc_pago_mat']); ?>" >

                                </div>
                            </div>  

                            <div class="control-group">
                                <label class="control-label" for="input02">NRO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="nro_comp_pago_mat5" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>
                            <input type="hidden" name="lote_doc_pago_mat5" value="NINGUNO">
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat5" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div>   
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DEL CHEQUE</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago5" value="<?php echo($ins['monto_rest_doc_pago']); ?>" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago5" value="<?php echo($ins['monto_efec_doc_pago']); ?>" >

                                </div>
                            </div>
                            
                            

                        </div>

                        <?php if($tipo_doc_pago_mat==6 ){?>
                        <div id="panel6" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel6" style="display: none;">
                        <?php }?>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO DE LA CUENTA</label>
                                <div class="controls">
                                    <select  id="select01"  class="span3" name="nom_doc_pago_mat6">
                        <?php
                        $ci->load->model('Institucion_Model');
                        $cuentas = $ci->Institucion_Model->getCuentasInstitucionNombre("INSTITUTO TECNOLOGICO SUPERIOR SUDAMERICANO LOJA");
                        foreach ($cuentas as $k => $cuenta) {
                            echo ("<option value='" . $cuenta["cuenta1_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta1_inst"]? " selected" : " "))."/>");
                            echo ($cuenta["cuenta1_inst"] . "-" . $cuenta["banco1_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta2_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta2_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta2_inst"] . "-" . $cuenta["banco2_inst"] . "</option>");
                            echo ("<option value='" . $cuenta["cuenta3_inst"] . "'" .(!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == $cuenta["cuenta3_inst"]? " selected" : " "))."/>");;
                            echo ($cuenta["cuenta3_inst"] . "-" . $cuenta["banco3_inst"] . "</option>");
                        }
                        ?>

                                    </select>

                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="input01">NRO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat6" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>  
                            <input type="hidden" name="lote_doc_pago_mat6" value="NINGUNO">
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat6" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div> 
                        <div class="control-group">
                            <label class="control-label" for="select012">FECHA DEL DEPOSITO</label>
                            <div class="controls">

                                <input type="text" class="input-medium "  id="datepicker3" name="fechadep_doc_pago_mat2" value="<?php echo date("m/d/Y", strtotime($ins['fechadep_doc_pago_mat'])); ?>" >

                            </div>
                        </div>
                            
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago6" value="<?php echo($ins['monto_rest_doc_pago']); ?>" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago6" value="<?php echo($ins['monto_efec_doc_pago']); ?>" >

                                </div>
                            </div>    
                            
                            </div>
                        <?php if($tipo_doc_pago_mat==7 ){?>
                        <div id="panel7" style="display: block;">
                        <?php }else{ ?>
                        <div id="panel7" style="display: none;">
                        <?php }?>
                            <div class="control-group">
                                <label class="control-label" for="input01">NOMBRE DE LA TARJETA</label>
                                <div class="controls">
                                    <select id="select01"  name="nom_doc_pago_mat7">

                                        <option value="MASTER CARD" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "MASTER CARD"? " selected" : " ")); ?>>MASTER CARD</option>
                                        <option value="DINERS CLUB" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "DINERS CLUB"? " selected" : " ")); ?> >DINERS CLUB</option>
                                        <option value="AMERICAN EXPRESS" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "AMERICAN EXPRESS"? " selected" : " ")); ?>>AMERICAN EXPRESS</option>
                                        <option value="VISA BANCO AUSTRO" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO AUSTRO"? " selected" : " ")); ?>>VISA BANCO AUSTRO</option>
                                        <option value="VISA BANCO MACHALA" <?php echo (!isset($nom_doc_pago_mat) ? " " : ($nom_doc_pago_mat == "VISA BANCO MACHALA"? " selected" : " ")); ?>>VISA BANCO MACHALA</option>
                                    </select>
                                </div>
                            </div>


                            <div class="control-group">
                                <label class="control-label" for="input02">NUMERO TARJETA</label>

                                <div class="controls">
                                    <input type="text" class="input-medium span2" name="nro_comp_pago_mat7" value="<?php echo($ins['nro_comp_pago_mat']); ?>" >

                                </div>
                            </div>



                            <div class="control-group">
                                <label class="control-label" for="input02">LOTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="lote_doc_pago_mat7" value="<?php echo($ins['lote_doc_pago_mat']); ?>" >

                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" for="input03">REFERENTE</label>
                                <div class="controls">
                                    <input type="text" class="input-medium span2"   name="ref_doc_pago_mat7" value="<?php echo($ins['ref_doc_pago_mat']); ?>" >

                                </div>
                            </div>  
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO DEL DEPOSITO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_rest_doc_pago7" value="<?php echo($ins['monto_rest_doc_pago']); ?>" >

                                </div>
                            </div>    
                            <div class="control-group">
                                <label class="control-label" for="input03">MONTO EN EFECTIVO</label>
                                <div class="controls">
                                    <input type="number" step="0.01" class="input-medium span1"   name="monto_efec_doc_pago7" value="<?php echo($ins['monto_efec_doc_pago']); ?>" >

                                </div>
                            </div>    
                            
                        </div>

                <div class="control-group">
                    <label class="control-label" for="input02">PAGO INICIAL</label>
                    <div class="controls">
                     <input readonly="true" value="<?php echo ($modo_mat==3?($costo_inscrip_lec+$costo_inscrip_conv_lec):$costo_inscrip_lec); ?>" style="width: 60px;" name="monto_canc_matr" id="pago_i"  
                               class="validate[required,maxSize[8],minSize[1],custom[number],min[0],max[10000]]" >
                        
                    </div>

                </div>


            </div>  <!--fin tabulador 3 -->
        </div>
    </div>

    <?php if (isset($msj_error)) { ?>
        <div class='MensajeError'>
            <?php echo ($msj_error); ?>
        </div>
    <?php } ?>




    
    <div class="controls">
        <?php if ($opc == 'upd') { ?>
        <button type="submit" class="btn">Modificar Inscripcion</button>

        <?php } else { ?>
            <button type="submit" class="btn">Eliminar Inscripcion</button>
        <?php } ?>


        <a href="<?php echo base_url() . "admin.php/pagoinscrip/inicio/".$ide_lec ?>">
            <img src="<?php echo base_url(); ?>commons/images/boton_volver.gif"></a>
        <input type="hidden"  name="opc" value="<?php echo $opc; ?>">

    </div> 



</form>


